(** 
    Utils.mli 
    A general library for the project. You will find i/o operations functions,
    global variables and useful functions.

    Bozman Çagdas <bozman.cagdas@gmail.com> - 2011
    Razakamiadana Tefin <tefy.razaka@gmail.com>   - 2011
*)

val debug : ('a, out_channel, unit) format -> 'a

(** **** I/O operations **** *)
(* Opens an input channel from a filename  *)
val open_in_file  : string -> in_channel

(* Opens an output channel from a filename. *)
val open_out_file : string -> out_channel

(* Reads a line from an input channel and return a string option.
   If end of file return None *) 
val read : in_channel -> string option

(* Write the string on the given output channel. *)
val write : out_channel -> string -> unit

(** **** Alias for several function and global variables **** *)
(* Alias for Printf.sprintf *)
val spf : ('a, unit, string) format -> 'a

(* from_group s n returns the nth element of the group from a regexp.
   Just like Str.matched_group, but does not failed and return empty
   string when raise Invalid_argument. *)
val from_group : string -> int -> string

(* This function format title with replacing space with %20, 
   backslash with double backslash, etc. *)
val format_title : string -> string

(* Returns an Ast.criteria list from a Ast.req. *)
val list_of_req : Ast.req -> Ast.criteria list

(* Regexp which define all expression to ignore from bfs and dfs. *)
val ignore : Str.regexp
